#ifndef __DEVICE_UART_H
#define __DEVICE_UART_H

#include <stdint.h>

// Abstraction Layer: Defines a generic UART device structure  
struct UART_Device 
{
    const char * name;		// Device name  
    int  (*Init)(struct UART_Device * pDev, int baud, int datas, char parity, int stop);	// Initialization function pointer 
    int  (*Send)(struct UART_Device * pDev, uint8_t *datas, int len, int timeout_ms);	 	// Send function pointer  
    int  (*Recv)(struct UART_Device * pDev, uint8_t *data, int timeout_ms);					// Receive function pointer  
    void *priv_data;		// Pointer to private data for device-specific information  
};

// Function to get a UART device by name  
struct UART_Device *GetUARTDevice(char *name);

#endif